import cv2
import gradio as gr


def to_gray(image):
    output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    return output

if __name__ == '__main__':
    interface = gr.Interface(fn=to_gray, inputs='image', outputs='image', 
        examples=['cat.jpg', 'dog.jpg'])
    interface.launch(share=True)
